<?php include "./view/htm/header.inc.htm"; ?>

<!--{hook forum_start.htm}-->

<!-- only for screenreader  -->
<a role="button" class="sr-only sr-focusable" href="<?php echo url('thread-create-'.$fid);?>"><?php echo lang('thread_create_new');?></a>

<div class="row">
	<div class="col-lg-9">
		<!--{hook forum_breadcrumb_before.htm}-->
		<ol class="breadcrumb m-b-sm hidden-lg-down">
			<li><a href="./"><i class="icon-home"></i></a></li>
			<li><a href="<?php echo url("forum-$fid");?>"><?php echo $forum['name'];?></a></li>
			<!--{hook forum_breadcrumb.htm}-->
		</ol>
		<!--{hook forum_breadcrumb_after.htm}-->
		<div class="card p-a-sm">
			<table class="table table-hover threadlist">
				<thead>
					<tr>
						<th colspan="3" class="p-a-0 p-b-sm">
							<dl class="row">
								<dt class="text-nowrap">
									<?php if($gid > 0 && $gid < 5) { ?>
									<input type="checkbox" data-target='input[name="modtid"]' class="checkall m-t-sm m-r-sm" value="" />
									<?php } ?>
									<b><?php echo lang('new_thread');?></b>
									<!--{hook forum_title_left.htm}-->
								</dt>
								<dd>
									<!--{hook forum_title_right.htm}-->
								</dd>
							</dl>
						</th>
					</tr>
				</thead>
				<tbody>
					<!--{hook forum_threadlist_before.htm}-->
					<?php include './view/htm/thread_list.inc.htm';?>
					<!--{hook forum_threadlist_after.htm}-->
				</tbody>
			</table>
		</div>
		<?php include './view/htm/thread_list_mod.inc.htm';?>
		<!--{hook forum_page_before.htm}-->
		<nav class="text-center"><ul class="pagination"><?php echo $pagination; ?></ul></nav>
		<!--{hook forum_page_after.htm}-->
	</div>
	<div class="col-lg-3 hidden-md-down">
		<a role="button" class="btn btn-primary btn-block btn-sm m-b-sm hidden-md-down" href="<?php echo url('thread-create-'.$fid);?>"><?php echo lang('thread_create_new');?></a>
		<div class="card">
			<img class="center-block m-t-1" data-src="holder.js/100%x180" alt="100%x180" src="<?php echo $forum['icon_url'];?>" width="100" height="100">
			<h4 class="text-center"><?php echo $forum['name'];?></h4>
			<!--{hook forum_brief_before.htm}-->
			<p class="m-x-1 text-middle"><?php echo $forum['brief'];?></p>
			<!--{hook forum_brief_before.htm}-->
			<div class="card-group card-group-nest">
				<div class="card">
					<div class="card-block">
						<div class="text-center text-muted small"><?php echo lang('today_posts');?></div>
						<h5 class="text-center"><?php echo $forum['todayposts'];?></h5>
					</div>
				</div>
				<div class="card">
					<div class="card-block">
						<div class="text-center text-muted small"><?php echo lang('today_threads');?></div>
						<h5 class="text-center"><?php echo $forum['todaythreads'];?></h5>
					</div>
				</div>
				<!--{hook forum_todaythreads_after.htm}-->
			</div>
		</div>
		<!--{hook forum_mod_before.htm}-->
		<?php if($forum['announcement'] || $forum['modlist']) { ?>
		<div class="card card-block">
			<?php if($forum['announcement']) { ?>
			<h6 class="text-bold"><?php echo lang('forum_anouncement');?>：</h6>
			<hr class="m-y-sm" />
			<p class="text-middle">
				<?php echo $forum['announcement'];?>
			</p>
			<?php  } ?>
			
			<?php if($forum['modlist']) { ?>
			<h6 class="text-bold"><?php echo lang('forum_moderator');?>：</h6>
			<hr class="m-y-sm" />
			<div class="row">
				<?php foreach ($forum['modlist'] as $mod) { ?>
				<div class="col-xs-3 m-b-1 text-center">
					<a href="#"><img src="view/img/avatar.png" alt="..." width="32" height="32" class="img-circle"></a><br>
					<a href="<?php echo url("user-$mod[uid]");?>" class="small text-muted text-nowrap"><?php echo $mod['username'];?></a>
				</div>
				<?php } ?>
			</div>
			<?php  } ?>
		</div>
		<?php  } ?>
		<!--{hook forum_mod_after.htm}-->
	</div>
</div>


<!--{hook forum_end.htm}-->

<?php include "./view/htm/footer.inc.htm"; ?>

<script>
$('#nav_pc li[fid="<?php echo $fid;?>"]').tab('show');
</script>

<!--{hook forum_js.htm}-->